﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Common
{
    public sealed class TMessageHeader
    {
        int Code;
        int SNumber;
        ushort UserGateIndex;
        ushort Ident;
        ushort UserListIndex;
        ushort temp;
        int length;
    }

    public sealed class TDefaultMessage
    {
        int Recog;
        ushort Ident;
        ushort Param;
        ushort Tag;
        ushort Series;
    }

    public sealed class TChrMsg
    {
        int Ident;
        int X;
        int Y;
        int Dir;
        int State;
        int feature;
        string saying;
        int Sound;
    }

    public sealed class TCharDesc
    {
        int Feature;
        int Status;
    }

    public sealed class TNakedAbility
    {
        ushort DC;
        ushort MC;
        ushort SC;
        ushort AC;
        ushort MAC;
        ushort HP;
        ushort MP;
        ushort Hit;
        ushort Speed;
        ushort Reserved;
    }

    public sealed class TChgAttr
    {
        byte attr;
        byte min;
        byte max;
    }

    public sealed class TStdItem
    {
        string Name;
        byte StdMode;
        byte Shape;
        byte Weight;
        byte AniCount;
        sbyte SpecialPwr;
        byte ItemDesc;
        ushort Looks;
        ushort DuraMax;
        ushort AC;
        ushort MAC;
        ushort DC;
        ushort MC;
        ushort SC;
        byte Need;
        byte NeedLevel;
        int Price;
        byte Stock;
        byte AtkSpd;
        byte Agility;
        byte Accurate;
        byte MgAvoid;
        byte Strong;
        byte Undead;
        byte HpAdd;
        byte MpAdd;
        byte ExpAdd;
        byte EffType1;
        byte EffRate1;
        byte EffValue1;
        byte EffType2;
        byte EffRate2;
        byte EffValue2;
        byte Slowdown;
        byte Tox;
        byte ToxAvoid;
        byte UniqueItem;
        byte OverlapItem;
        byte light;
        byte ItemType;
        ushort ItemSet;
        string Reference;
        byte Flexibility;
        byte SuccessRate;
    }

    public sealed class TUserItem // Packed
    {
        int MakeIndex;
        ushort Index;
        ushort Dura;
        ushort DuraMax;
        byte[] Desc;
        byte ColorR;
        byte ColorG;
        byte ColorB;
        char[] Prefix;
    }

    public sealed class TAbility
    {
        byte Level;
        ushort AC;
        ushort MAC;
        ushort DC;
        ushort MC;
        ushort SC;
        ushort HP;
        ushort MP;
        ushort MaxHP;
        ushort MaxMP;
        byte ExpCount;
        byte ExpMaxCount;
        uint Exp;
        uint MaxExp;
        ushort Weight;
        ushort MaxWeight;
        byte WearWeight;
        byte MaxWearWeight;
        byte HandWeight;
        byte MaxHandWeight;
        int FameCur;
        int FameBase;
    }

    public sealed class TAddAbility
    {
        ushort HP;
        ushort MP;
        ushort HIT;
        ushort SPEED;
        ushort AC;
        ushort MAC;
        ushort DC;
        ushort MC;
        ushort SC;
        ushort AntiPoison;
        ushort PoisonRecover;
        ushort HealthRecover;
        ushort SpellRecover;
        ushort AntiMagic;
        byte Luck;
        byte UnLuck;
        byte WeaponStrong;
        byte UndeadPower;
        sbyte HitSpeed;
        byte Slowdown;
        byte Poison;
        byte Flexibility;
        byte SuccessRate;
    }

    public sealed class TPricesInfo
    {
        ushort Index;
        int SellPrice;
    }

    public sealed class TClientGoods
    {
        string Name;
        byte SubMenu;
        int Price;
        int Stock;
        int Looks;
        sbyte Grade;
    }

    public sealed class TClientJangwon
    {
        int Num;
        string GuildName;
        string CaptainName1;
        string CaptainName2;
        int SellPrice;
        string SellState;
    }

    public sealed class ClientGABoard
    {
        string WriteUser;
        string TitleMsg;
        int IndexType1;
        int IndexType2;
        int IndexType3;
        int IndexType4;
        int ReplyCount;
    }

    public sealed class TClientGADecoration
    {
        int Num;
        string Name;
        int Price;
        int ImgIndex;
        int CaseNum;
    }

    public sealed class TClientItem
    {
        TStdItem S;
        int MakeIndex;
        ushort Dura;
        ushort DuraMax;
        int UpgradeOpt;
        ushort Other;
    }

    public sealed class TUserStateInfo
    {
        int Feature;
        string UserName;
        int NameColor;
        string GuildName;
        string GuildRankName;
        TClientItem[] UseItems;
        bool BoExistLover;
        string LoverName;
        string FameName;
    }

    public sealed class TDropItem
    {
        int Id;
        ushort X;
        ushort Y;
        ushort Looks;
        uint FlashTime;
        bool BoFlash;
        uint FlashStepItem;
        int FlashStep;
        string Name;
        bool BoDeco;
    }

    public sealed class TDefMagic
    {
        ushort MagicId;
        string MagicName;
        byte EffectType;
        byte Effect;
        ushort Spell;
        ushort MinPower;
        byte[] NeedLevel;
        byte[] MaxTrain;
        byte MaxTrainLevel;
        byte Job;
        int DelayTime;
        byte DefSpell;
        byte DefMinPower;
        ushort MaxPower;
        byte DefMaxPower;
        string Desc;
    }

    public sealed class TUserMagic
    {
        TDefMagic pDef; // pointer
        ushort MagicId;
        byte Level;
        char Key;
        int CurTrain;
    }

    public sealed class TClientMagic
    {
        char Key;
        byte Level;
        int CurTrain;
        TDefMagic Def;
    }

    public sealed class TFriend
    {
        string CharID;
        byte Status;
        string Memo;
    }

    public sealed class TMail
    {
        string Sender;
        string Date;
        string Mail;
        byte Status;
    }

    public sealed class TRelationship
    {
        string CharID;
        byte Level;
        byte Sex;
        byte Staus;
        string Date;
    }

    public sealed class TSkillInfo
    {
        ushort SkillIndex;
        ushort Reserved;
        int CurTrain;
    }

    public sealed class TMapItem
    {
        TUserItem UserItem;
        string Name;
        ushort Looks;
        byte AniCount;
        byte Reserved;
        int Count;
        object Ownership;
        uint Droptime;
        object Droper;
    }

    public sealed class TAgitDecoItem
    {
        string Name;
        ushort Looks;
        string MapName;
        ushort x;
        ushort y;
        string Maker;
        ushort Dura;
    }

    public sealed class TVisibleItemInfo
    {
        byte check;
        ushort x;
        ushort y;
        int Id;
        string Name;
        ushort looks;
    }

    public sealed class TVisibleActor
    {
        byte check;
        object cret;
    }

    public sealed class TMapEventInfo
    {
        byte check;
        int x;
        int y;
        object EventObject;
    }

    public sealed class TGateInfo
    {
        byte GateType;
        object EnterEnvir;
        int EnterX;
        int EnterY;
    }

    public sealed class TAThing
    {
        byte Shape;
        object AObject;
        uint ATime;
    }

    public sealed class TMapInfo
    {
        byte MoveAttr;
        bool Door;
        byte Area;
        byte Reserved;
        List<object> OBJList;
    }

    public sealed class TUserEntry
    {
        string sAccount;
        string sPassword;
        string sUserName;
        string sSSNo;
        string sPhone;
        string sQuiz;
        string sAnswer;
        string sEMail;
    }

    public sealed class TUserEntryAdd
    {
        string sQuiz2;
        string sAnswer2;
        string sBirthDay;
        string sMobilePhone;
        string sMemo;
        string sMemo2;
    }

    public sealed class TUserCharatcerInfo
    {
        string EncName;
        byte Sex;
        byte Hair;
        byte Job;
        byte Level;
        string EncEncName;
    }

    public sealed class TLoadHumn
    {
        char[] UsrId;
        char[] ChrName;
        char[] UsrAddr;
        int CertifyCode;
    }

    public sealed class TMonsterInfo
    {
        string Name;
        byte Race;
        byte RaceImg;
        ushort Appr;
        byte Level;
        byte LifeAttrib;
        byte CoolEye;
        ushort Exp;
        ushort HP;
        ushort MP;
        byte AC;
        byte MAC;
        int DC;
        int MaxDC;
        int MC;
        int SC;
        byte Speed;
        byte Hit;
        ushort WalkSpeed;
        ushort WalkStep;
        ushort WalkWait;
        ushort AttackSpeed;
        ushort Tame;
        ushort AntiPush;
        ushort AntiUndead;
        ushort SizeRate;
        ushort AntiStop;
        List<object> ItemList;
    }

    public sealed class TZenInfo
    {
        string MapName;
        int X;
        int Y;
        string MonName;
        int MonRace;
        int Area;
        int Count;
        uint MonZenTime;
        uint StartTime;
        List<object> Mons;
        int SmallZenRate;

        int TX;
        int TY;
        int ZenShoutType;
        int ZenShoutMsg;
    }

    public sealed class TMonItemInfo
    {
        int SelPoint;
        int MaxPoint;
        string ItemName;
        int Count;
    }

    public sealed class TMarketProduct
    {
        string GoodsName;
        int Count;
        int ZenHour;
        uint ZenTime;
    }

    public sealed class TMarketItem
    {
        TClientItem Item;
        int UpgCount;
        int Index;
        int SellPrice;
        string SellWho;
        string SellDate;
        ushort SellState;
    }

    public sealed class TMarketLoad
    {
        TUserItem UserItem;
        int Index;
        int MarketType;
        int SetType;
        int SellCount;
        int SellPrice;
        string ItemName;
        string MarketName;
        string SellWho;
        string SellDate;
        ushort SellState;
        int IsOK;
    }

    public sealed class TSearchSellItem
    {
        string MarketName;
        string Who;
        string ItemName;
        int MakeIndex;
        int ItemType;
        int ItemSet;
        int SellIndex;
        int CheckType;
        int IsOK;
        int UserMode;
        List<object> pList;
    }

    public sealed class TMarketReyInfo
    {
        string UserName;
        string MarketName;
        string SearchWho;
        string SearchItem;
        int ItemType;
        int ItemSet;
        int UserMode;
    }

    public sealed class TSearchGABoardList
    {
        int AgitNum;
        string GuildName;
        int OrgNum;
        int SrcNum1;
        int SrcNum2;
        int SrcNum3;
        int Kind;
        string UserName;
        List<object> ArticleList;
    }

    public sealed class TGABoardArticleLoad
    {
        int AgitNum;
        string GuildName;
        int OrgNum;
        int SrcNum1;
        int SrcNum2;
        int SrcNum3;
        int Kind;
        string UserName;
        char[] Content;
    }

    public class Global
    {
        #region Event Types - 07/08/2010 - Kyndig

        public const int ET_DIGOUTZOMBI = 1;
        public const int ET_MINE = 2;
        public const int ET_PILESTONES = 3;
        public const int ET_HOLYCURTAIN = 4;
        public const int ET_FIRE = 5;
        public const int ET_SCULPEICE = 6;
        public const int ET_FIRE2 = 7;
        public const int ET_TRAP = 8;
        public const int ET_MINE2 = 9;
        public const int ET_MINE3 = 10;
        public const int ET_BLIZZARD = 11;
        public const int ET_HEARTPALP = 13;
        public const int ET_POISONCLOUD = 14;
        public const int ET_METEOR = 15;

        #endregion

        #region "Server Message Constants"

        public const int SM_ACTION_MIN = 5;
        public const int SM_THROW = 5;
        public const int SM_RUSH = 6;  //¾ÕÀ¸·Î ÀüÁø
        public const int SM_RUSHKUNG = 7;  //¾ÕÀ¸·Î ÀüÁø½ÇÆÐ
        public const int SM_FIREHIT = 8;  //¿°È­°á
        public const int SM_BACKSTEP = 9;  //µÞ°ÉÀ½Áú,
        public const int SM_TURN = 10;
        public const int SM_WALK = 11;
        public const int SM_SITDOWN = 12;
        public const int SM_RUN = 13;
        public const int SM_HIT = 14;
        public const int SM_HEAVYHIT = 15;
        public const int SM_BIGHIT = 16;
        public const int SM_SPELL = 17;
        public const int SM_POWERHIT = 18;
        public const int SM_LONGHIT = 19;  //´õ ¼¼°Ô ¶§¸²
        public const int SM_DIGUP = 20;  //¶¥ÆÄ°í ³ª¿À´Ù.
        public const int SM_DIGDOWN = 21;  //¶¥ÆÄ°í µé¾î°¡ ¼û´Ù.
        public const int SM_FLYAXE = 22;
        public const int SM_LIGHTING = 23;  //¸¶¹ý »ç¿ë
        public const int SM_WIDEHIT = 24;
        public const int SM_ACTION_MAX = 25;

        #endregion

    }
}
